#ifndef AUDIOINFOOUTPUT_H
#define AUDIOINFOOUTPUT_H

#include <QIODevice>

#include "opensl_engine.h"

#include <ClientImpl/Receive_handler.h>

#include <Task_Base/CriticalSection.h>

#include <queue>
#include <string>
using namespace std;

class AudioInfoOutPut: public Receive_handler
{
public:
    AudioInfoOutPut(OpenSl_Engine *);
    ~AudioInfoOutPut();
public:
    void start();
    void stop();
public:
    virtual bool receive_handler(char *data,int size);
protected:
    static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context);
    void PlayerCallback(SLAndroidSimpleBufferQueueItf bq);
private:
    CCriticalSection oCriSection;

    std::string  m_OutPut_buf;

    OpenSl_Engine *m_pOpenSlEngine;

    SLVolumeItf bqPlayerVolume;
    SLEffectSendItf bqPlayerEffectSend;
    SLPlayItf bqPlayerPlay;
    SLObjectItf bqPlayerObject ;
    SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue;

    std::queue<std::string> msg_queue_audio;
    bool bE;
};

#endif // AUDIOINFOOUTPUT_H
